import Vue from 'vue';
import VueRouter from 'vue-router';
import routes from '../routes/routes';
import {defined} from './defined';
Vue.use(VueRouter);
const router=new VueRouter({
    routes,
    mode:'history',
    scrollBehavior(to){
        let arr=['detail-info','detail-rule','detail-after','detail-ratings','detail-phone']
        if(arr.includes(to.name)){
            if(to.name==='detail-info'&&to.redirectedFrom){
                return {x:0,y:0}
            }
        }else{
            return {x:0,y:0}
        }
    
    },
    linkActiveClass:'active'
})
defined(router)
export default router
